package com.ruyuan.scholartrade.controller;

import com.scholar.shop.common.CommonRes;
import com.scholar.shop.trad.bill.api.BillApi;
import com.scholar.shop.trad.bill.domain.BillItemVO;
import com.scholar.shop.trad.bill.domain.BillRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author fk
 * @version v1.0
 * @Description: 结算单对外接口实现
 * @date 2018/7/26 11:22
 * @since v7.0.0
 */
@CrossOrigin
@RestController
@RequestMapping("/trade/bill/")
public class BillOpenApiController{

    @Autowired
    private BillApi billApi;



        @PostMapping("/createBills")
    public CommonRes<Boolean> createBills(@RequestParam Long startTime, @RequestParam Long endTime) {

       return this.billApi.createBills(startTime,endTime);
    }

   
    @PostMapping("/addBill")
    public CommonRes<BillItemVO> add(@RequestBody BillRequest billItem) {

         return this.billApi.add(billItem);
    }

}
